package cn.fz.redisdemo01.web;

import cn.fz.redisdemo01.service.LockService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

// 原文链接：https://blog.csdn.net/u014390502/article/details/142724359
@RestController
public class LockController {
    private final LockService lockService;

    public LockController(LockService lockService) {
        this.lockService = lockService;
    }

    @GetMapping("/test-lock")
    public String testLock() {
        lockService.doSomethingWithLock();
        return "分布式锁测试完成";
    }

}
